package lines.gameengine;

import lines.gameengine.context.IFieldContext;
import lines.gameengine.exception.LinesEngineException;

import java.util.Collection;
import java.util.List;

/**
 * @author vpotapenko
 */
public interface IField {

    void prepare() throws LinesEngineException;

    void reset();

    ICell getCell(int x, int y);

    ICell getCell(FieldPoint point);

    int getWidth();

    int getHeight();

    IFieldContext getContext();

    boolean isValidPoint(int x, int y);

    boolean isValidPoint(FieldPoint point);

    void clearCells(Collection<FieldPoint> points);

    void moveBall(FieldPoint startPoint, FieldPoint endPoint, List<FieldPoint> trace);

    void addNewBall(FieldPoint point, IBall ball) throws LinesEngineException;

    void setSelectedPoint(FieldPoint point);

    FieldPoint getSelectedPoint();

    void addListener(IFieldListener l);

    void removeListener(IFieldListener l);
}
